#include<stdio.h>
int main()
{
	int N = 0;
	int arr[10][10] = { 0 };
	int i, j;
	int flag = 0;
	scanf("%d", &N);
	for (i = 0; i < N;i++) 
	{
		for (j = 0; j < N; j++)
		{
			scanf("%d", &arr[i][j]);
		}
	}
	for (i = 0; i < N; i++)
	{
		for (j = 0; j < i; j++)
		{
			if (arr[i][j] != 0)
			{
				flag = 1;
				goto end;
			}
		}
	}
end:
	if (flag == 1)
	{
		printf("no\n");
	}
	else
	{
		printf("yes\n");
	}
	return 0;
}